home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / dev / basic / Mildred.lha / lha / ILBMviewer.lha / ILBMviewer.ascii < prev    next >
Text File  |  1998-11-25  |  2KB  |  100 lines

  1. WBStartup
  2.  
  3. ;Main
  4.  
  5. DEFTYPE.w
  6.  
  7. INCLUDE "Prefs.bb2"
  8. INCLUDE "Variables.bb2"
  9. INCLUDE "Chunky.bb2"
  10. INCLUDE "Display.bb2"
  11.  
  12. MReservec2pWindows 4
  13. MReserveBitmaps 3
  14.  
  15. MaxLen ASLfile$=256
  16. MaxLen ASLpath$=256
  17. ASLpath$="Data:Pictures/IFF1"
  18. FindScreen 0
  19. Land$=ASLFileRequest$("Choose an ILBM picture)",ASLpath$,ASLfile$)
  20. If InitLand{Land$,0,0,0}=False Then Goto Finish
  21. YOff.l=(LandHeight-ILBMActualHeight)*LandWidth
  22. ChunkyCopy16{LandBuffer+YOff,LandBuffer2+YOff,ILBMActualHeight,CPUminimum,LandWidth,LandWidth} ; Duplicate
  23. If InitDisplay{"Game"}=False Then Goto Finish
  24. ShowPalette 0
  25. Multitasking{On}
  26. buf.b=0
  27. its.l=0
  28. *Scr._Screen=Peek.l(Addr Screen(0))
  29. xmult.q=(LandWidth-PrefDisplayWidth)/PrefDisplayWidth
  30. ymult.q=(LandHeight-PrefDisplayHeight)/PrefDisplayHeight
  31. LandX.w=0
  32. LandY.w=0
  33. MemOffset.l=0
  34. For mode.b=0 To 3
  35.   If mode MOD 2=1 Then Mc2pRowLacing On Else Mc2pRowLacing Off
  36.   If mode>1 Then Mc2pColumnLacing On Else Mc2pColumnLacing Off
  37.   Mc2pWindow mode,PrefDisplayWidth,PrefDisplayHeight,LandWidth,CPUminimum,PrefDisplayWidth,PrefDisplayHeight
  38. Next mode
  39. Mc2pRowLacing PrefDisplayLacing
  40. Mc2pColumnLacing PrefDisplayColumning
  41. c2pLaceMode.b=PrefDisplayLacing+(PrefDisplayColumning LSL 1)
  42. M040c2pUsage On
  43. MCPU CPUminimum
  44. Mc2pCPUmode CPUminimum
  45. ResetTimer
  46. While Joyb(0)<>1 AND Joyb(1)=0
  47.  
  48.   If Joyb(0)=2
  49.     c2pLaceMode+1
  50.     If c2pLaceMode=4 Then c2pLaceMode=0
  51.     If c2pLaceMode MOD 2=1 Then Mc2pRowLacing On Else Mc2pRowLacing Off
  52.     If c2pLaceMode>1 Then Mc2pColumnLacing On Else Mc2pColumnLacing Off
  53.     VWait 25
  54.     its=0
  55.     ResetTimer
  56.   EndIf
  57.  
  58.   If PrefDisplayBuffering>1
  59.     buf+1
  60.     If buf=PrefDisplayBuffering Then buf=0
  61.   EndIf
  62.   Mc2pToggle PrefDisplayBuffering,buf
  63.  
  64.   LandX.w=SMouseX*xmult
  65.   LandY=SMouseY*ymult
  66.  
  67.   If IsAGA
  68.     Mc2p c2pLaceMode,MBitmapPtr(LandX,LandY),PlanarBuf(buf)
  69.     ShowBitMap buf
  70.   Else
  71.     *RP._RastPort=RastPort(buf)
  72.     For Y=0 To PrefDisplayHeight-1
  73.       WritePixelLine8_ *RP,0,Y,PrefDisplayWidth-1,MemOffset+(LandWidth*Y),0
  74.     Next Y
  75.     *ScrVP\DyOffset=BufNum*PrefDisplayHeight
  76.     ScrollVPort_ *ScrVP
  77.   EndIf
  78.  
  79.   its+1
  80. Wend
  81. t=Timer
  82. t=Max(t,1)
  83. its=Max(its,1)
  84. a.q=50.0/(t/its)
  85. ScreenToBack_ NPeekL(Addr Screen(0))
  86. VWait 50
  87. FindScreen 1
  88. Window 2,16,16,300,40,0,"Test results",1,0
  89. WindowOutput 2
  90. NPrint a," frames per second"
  91. NPrint " "
  92. NPrint "Press mouse/joy button..."
  93. Repeat
  94. Until Joyb(0)<>0 OR Joyb(1)<>0
  95.  
  96. Finish:
  97. Multitasking{On}
  98. End
  99.  
  100.